package com.zz.parkingsystem.mapper;

import com.zz.parkingsystem.dto.OrderDTO;
import com.zz.parkingsystem.dto.aaa;
import com.zz.parkingsystem.entity.OrderItem;
import com.zz.parkingsystem.vo.OrderUserVO;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import com.zz.parkingsystem.vo.OrderItemVo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import com.zz.parkingsystem.vo.AllOrderitemBySectionVo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import javax.xml.crypto.Data;
import java.util.Date;
import java.util.List;

/**
* @author zz
* @description 针对表【t_order_item(订单项表)】的数据库操作Mapper
* @createDate 2022-08-29 19:50:26
* @Entity com.zz.parkingsystem.entity.OrderItem
*/
@Repository
@Mapper
public interface OrderItemMapper {
    Long getCountOrder(OrderDTO orderDto);
    List<OrderUserVO> getOrderMes(Long id);

    int deleteByPrimaryKey(Long id);

    int insert(OrderItem record);

    int insertSelective(OrderItem record);

    OrderItem selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(OrderItem record);

    int updateByPrimaryKey(OrderItem record);

    OrderItem selOrderItemByUserIdAndUnpaid(Long userId);

    OrderItem selOrderItemByOiNo(String oiNo);

    List<OrderItem> selAllOrderItemByUserId(Integer userId);

    List<OrderItemVo> getPaymentAmount();

    List<OrderItem> getOrdersTotal();

    /**
     * 根据订单编号查订单项表
     *
     * @param oiNo 订单编号
     * @return 订单项表
     */
    OrderItemVo getUnrecorded(String oiNo);

    List<OrderItem> getUnrecordedVehicle(int pkno);

    List<OrderItem> selectByCarname(String carLicensePlate);
    //(巡检端业务)巡检按照当日时间查所有订单和订单相关信息
    List<AllOrderitemBySectionVo> selAllBySection(Integer order_status);
    //巡检查询一个订单以及相关信息
    AllOrderitemBySectionVo selOneOrderItem(String oi_no);
    //巡检查询一个订单的照片路径
    OrderItem selImg(String oi_no);
    //统计所有订单数量
    int selOrderSum();
    //统计所有金额
    double selMoneySum();
    //统计所有退款订单数量
    //根据日期查当日订单数量
    int SumNumberBytime(Date oi_start_time);
    //根据日期查当日订单金额
    double SumMoneyBytime(Date oi_start_time);
    int selRefundSum();
}
